﻿using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace SmartHotel.Migrations
{
    public partial class create房态修改字段 : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropColumn(
                name: "CustomPrice",
                table: "SmartHotel_HouseRoom");

            migrationBuilder.AddColumn<decimal>(
                name: "AveragePrice",
                table: "SmartHotel_HouseTable",
                type: "decimal(18,2)",
                nullable: false,
                defaultValue: 0m);

            migrationBuilder.AddColumn<int>(
                name: "OrderState",
                table: "SmartHotel_HouseRoom",
                type: "int",
                nullable: false,
                defaultValue: 0);

            migrationBuilder.AlterColumn<string>(
                name: "RoomNumbet",
                table: "SmartHotel_CheckInTable",
                type: "nvarchar(max)",
                nullable: true,
                oldClrType: typeof(int),
                oldType: "int");

            migrationBuilder.AddColumn<string>(
                name: "HouseType",
                table: "SmartHotel_CheckInTable",
                type: "nvarchar(max)",
                nullable: true);
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropColumn(
                name: "AveragePrice",
                table: "SmartHotel_HouseTable");

            migrationBuilder.DropColumn(
                name: "OrderState",
                table: "SmartHotel_HouseRoom");

            migrationBuilder.DropColumn(
                name: "HouseType",
                table: "SmartHotel_CheckInTable");

            migrationBuilder.AddColumn<decimal>(
                name: "CustomPrice",
                table: "SmartHotel_HouseRoom",
                type: "decimal(18,2)",
                nullable: false,
                defaultValue: 0m);

            migrationBuilder.AlterColumn<int>(
                name: "RoomNumbet",
                table: "SmartHotel_CheckInTable",
                type: "int",
                nullable: false,
                defaultValue: 0,
                oldClrType: typeof(string),
                oldType: "nvarchar(max)",
                oldNullable: true);
        }
    }
}
